package stack.era.domain.world;

import stack.era.constants.WorldAttributes;
import stack.era.constants.WorldAttributes.Month;
import stack.era.domain.DomainObject;

public class World extends DomainObject {

	private static final long serialVersionUID = -5187759481530554726L;

	private String playerCharacterName;

	private int hour, day, year;

	private Month month;

	public World() {
		super("World");

		this.hour = 8;
		this.day = 1;
		this.year = 1;
		this.month = Month.JANUARY;
	}

	public String getPlayerCharacterName() {
		return playerCharacterName;
	}

	public void setPlayerCharacterName(String playerCharacterName) {
		this.playerCharacterName = playerCharacterName;
	}

	@Override
	public void update() {
		// TODO Auto-generated method stub

	}

	public void moveForwardOneHour() {
		this.hour++;
		if (this.hour > WorldAttributes.HOURS_IN_DAY) {
			this.hour = 1;
			this.day++;
			if (this.day > this.month.getNumDays()) {
				this.day = 1;
				this.month = this.month.getNextMonth();
				if(this.month == Month.JANUARY) {
					this.year++;
				}
			}
		}
	}

	public int getHour() {
		return hour;
	}

	public int getDay() {
		return day;
	}

	public Month getMonth() {
		return month;
	}
	
	public int getYear() {
		return year;
	}

}
